<%--
  Created by IntelliJ IDEA.
  User: LV
  Date: 2016/6/27
  Time: 18:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="from" uri="http://www.springframework.org/tags/form" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>


<html>
<head>
    <title>分类属性添加</title>
</head>
<body>
<div class="row">
    <div class="col-md-12">
        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
        <h3 class="page-title">
            分类属性管理
            <small>编辑分类属性</small>
        </h3>
        <ul class="page-breadcrumb breadcrumb">
            <li>
                <i class="fa fa-home"></i>
                <a href="${ctx}/main">
                    首页
                </a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="${ctx}/sys/role_list">
                    分类属性管理
                </a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="#">
                    编辑分类属性
                </a>
            </li>
        </ul>
        <!-- END PAGE TITLE & BREADCRUMB-->
    </div>
</div>
<div class="main">

    <div class="row">
        <div class="col-md-12">
            <form:form modelAttribute="categoryAttribute" method="post" class="form-horizontal" action="${ctx}/category/savingEditCategoryAttribute">
                <div class="form-body">
                    <input name="attributeId" type="hidden" value="${categoryAttribute.attributeId}">
                    <input name="pCategoryCategoryId" type="hidden" value="${categoryAttribute.pCategoryCategoryId}"/>
                    <div class="form-group">
                        <label class="control-label col-md-3">属性名称：</label>
                        <div class="col-md-4">
                            <input type="text" name="attributeName" class="form-control" value="${categoryAttribute.attributeName}"/>
                                <%--<form:input path="attributeName" cssClass="form-control" placeholder=""></form:input>--%>
                        </div>
                        <form:errors path="attributeName" cssClass="field-validation-error" element="div"></form:errors>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-md-3">属性类型：</label>
                        <div class="col-md-4">
                            <%--<select name="attributeType">--%>
                                <%--<option  value="1">商品属性</option>--%>
                                <%--<option  value="2" selected="selected">商品规格</option>--%>
                            <%--</select>--%>
                            <form:select path="attributeType">
                                <form:option value="1" label="商品属性"/>
                                <form:option value="2" label="商品规格"/>
                            </form:select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="control-label col-md-3">是否允许上传图片：</label>
                        <div class="col-md-4">
                            <%--<select name="isAllowedUpload" >--%>
                                <%--<option value="1" >否</option>--%>
                                <%--<option value="2" >是</option>--%>
                            <%--</select>--%>
                            <form:select path="isAllowedUpload">
                                <form:option value="1" label="是"/>
                                <form:option value="2" label="否"/>
                            </form:select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="control-label col-md-3">值：</label>
                        <div class="col-md-4">
                            <textarea name="attributeValue"></textarea>
                        </div>

                    </div>

                    <div class="form-group">
                        <label class="control-label col-md-3">排序：</label>
                        <div class="col-md-4">
                            <input type="text" name="orderNum" class="form-control" value="${categoryAttribute.orderNum}"/>
                                <%--<form:input path="orderNum" placeholder=""></form:input>--%>
                        </div>
                        <form:errors path="orderNum" cssClass="field-validation-error" element="div"></form:errors>
                    </div>

                    <div class="form-group">
                        <label class="control-label col-md-3">状态：</label>
                        <div class="col-md-4">
                            <%--<select name="isAllowedUpload" >--%>
                                <%--<option value="0" selected="selected">正常</option>--%>
                                <%--<option value="1" >禁用</option>--%>
                            <%--</select>--%>
                            <form:select path="status">
                                <form:option value="0" label="禁用"/>
                                <form:option value="1" label="正常"/>
                            </form:select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="control-label col-md-3">是否公用：</label>
                        <div class="col-md-4">
                            <%--<label><input name="isAdaptAll" type="radio" value="1"  checked/>是 </label>--%>
                            <%--<label><input name="isAdaptAll" type="radio" value="0" />否 </label>--%>
                            <form:radiobutton path="isAdaptAll" value="1" label="是"/>
                            <form:radiobutton path="isAdaptAll" value="0" label="否"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-md-9 col-md-offset-3 ">
                            <input type="submit" value="提交" class="btn green"/>
                            <a href="${ctx}/category/findAllAttributeByCategoryId/${categoryAttribute.pCategoryCategoryId}" class="btn btn-default">取消</a>
                        </div>
                    </div>

                </div>

            </form:form>
        </div>
    </div>


</div>
</body>
</html>

